--- Do not modify below unless you know what you're doing // lol joke
Logo = States:Register("logo", Class:Create())

local x = sx / 2 - 256
local y = sy / 2 - 128

local t = getTickCount()
local ms = 3000 -- 3000
local JoinMusic

local function onRender()
	if getTickCount() - t <= ms then
		Screen:Image(x + math.random(-2, 2), y + math.random(-2, 2), 512, 256, "resources/img/logo.png", 0, 0, 0, tocolor(255, 255, 255, a))
	else
		States:Change("chooser")
	end
end

local function onReceive(_, data)
	teams = data
end

function Logo:Start()
	onClientRender:Handle(onRender)
	onChooserReceive:Handle(onReceive)
	JoinMusic = playSound("resources/sounds/loop.mp3", true)
end

function Logo:Stop(Source)
	onClientRender:Remove(logo_onRender)
	onClientChooserReceive:ServerTrigger(getLocalPlayer())
end

States:Change("logo")